// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Data/CommonEnum.h"
#include "Data/MissionStruct.h"
#include "CompassWidget.generated.h"

class USingleDirectionWidget;
class USingleMarkerWidget;

UCLASS()
class MISCELLANEOUSPROJECT_API UCompassWidget : public UUserWidget
{
	GENERATED_BODY()
public:
	virtual void NativePreConstruct() override;
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	USingleDirectionWidget* AddDirection(const FDirections& Direction, TSubclassOf<USingleDirectionWidget> DirectionWidgetClass);
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	USingleMarkerWidget* AddMarker(FTargetInfo TargetInfo, TSubclassOf< USingleMarkerWidget> WidgetClass);
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	void ToggleCompassVisibility(EToggleVisibility InVisibility);
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	USingleMarkerWidget* AddLandmark(FMarkerCustomization MarkerCustomization, TSubclassOf< USingleMarkerWidget> MarkerWidgetClass);
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	void UpdateSpecialArea(EToggleVisibility HighlightVisibility, EToggleVisibility TextVisibility, FLinearColor InBrushColor, FText InText);
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	void UpdateCompassColor();
	UFUNCTION(BlueprintCallable, Category = MissionComponent)
	void ClearHighlightTimer();
private:
	void CompassVisibleColor();
	void CompassHiddenColor();
	void ClearTimer();
public:
	UPROPERTY(meta = (BindWidget))
	class UOverlay* CompassMarkerOverlay;
	UPROPERTY(meta = (BindWidget))
	class UOverlay* DirectionOverlay;
	UPROPERTY(meta = (BindWidget))
	class UBorder* Compass;
	UPROPERTY(meta = (BindWidget))
	class USlider* SliderFade;
	UPROPERTY(meta = (BindWidget))
	class UBorder* DynamicBackground;
	UPROPERTY(meta = (BindWidget))
	class UTextBlock* CompassText;
	UPROPERTY(meta = (BindWidget))
	class UBorder* TextBackground;
	UPROPERTY(meta = (BindWidget))
	class UBorder* Background;
	UPROPERTY(meta = (BindWidget))
	class UOverlay* CompassTextOverlay;

	TArray<USingleMarkerWidget*> CompassMarkers;
	TArray<USingleMarkerWidget*> ScreenMarkers;
	TArray<USingleMarkerWidget*> Landmarks;
	TArray<USingleDirectionWidget*> DirectionWidgets;
	TArray<USingleMarkerWidget*> HiddenMarkers;
	FLinearColor SpecialAreaInBrushColor;
	EToggleVisibility SpecialAreaVisibility;
	EToggleVisibility SpecialAreaTextVisibility;
	FTimerHandle HighlightTimerHandle;
	FTimerHandle UniqueHandle;
	float ColorAlphaChange;
};
